﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Hook.Graphics;
using Hook.Graphics.SpriteSheets;

namespace Hook.Primitives
{
    public class PolyPoint
    {
        public Sprite Sprite;
        public Vector3 Position;

        public PolyPoint()
            : this(Vector3.Zero)
        {
        }

        public PolyPoint(Vector3 Position)
        {
            this.Position = Position;
            Sprite = new Sprite(Game1.PrimitiveSheet, PrimitiveSheet.POINTBOX);
        }

        public void Update(GameTime gt)
        {
            Sprite.Position = Position;
            Sprite.Update(gt);
        }
        public void Draw(SpriteBatch sb, Camera Cam)
        {
            Sprite.Draw(sb, Cam);
        }

        public static PolyPoint AveragePoint(PolyPoint P1, PolyPoint P2)
        {
            return new PolyPoint(new Vector3((P1.Position.X + P2.Position.X) / 2, (P1.Position.Y + P2.Position.Y) / 2, (P1.Position.Z + P2.Position.Z) / 2));
        }
    }
}
